home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Frameworks / Grant's CGI Framework 1.0b14 / Interface / SplashScreen.c < prev    next >
Text File  |  1996-04-08  |  2KB  |  84 lines

  1. /*****
  2.  *
  3.  *    SplashScreen.c
  4.  *
  5.  *    If you don't want a splash screen for your CGI, remove this file and the two
  6.  *    SplashScreen calls made in the function 'StartupApplication' in "Startup.c".
  7.  *    Also remove the resources: cicn #128, ICON #128, dctb #401, DITL #401, DLOG #401
  8.  *
  9.  *    This is a support file for "Grant's CGI Framework".
  10.  *    Please see the license agreement that accompanies the distribution package
  11.  *    for licensing details.
  12.  *
  13.  *    Copyright ©1995,1996 by Grant Neufeld
  14.  *    grant@acm.com
  15.  *    http://arpp.carleton.ca/grant/
  16.  *
  17.  *****/
  18.  
  19. #include "MyConfiguration.h"
  20. #if kCompileWithForeground && kCompileWithSplashScreen
  21.  
  22. #include "compiler_stuff.h"
  23. #include "globals.h"
  24.  
  25. #include "DebugUtil.h"
  26.  
  27. #include "SplashScreen.h"
  28.  
  29.  
  30. /***  LOCAL VARIABLES ***/
  31.  
  32. static    DialogPtr    vSplashScreenDlog;
  33. static    GrafPtr        vSplashScreenSavePort;
  34.  
  35.  
  36. /***  LOCAL CONSTANTS ***/
  37.  
  38. #define kSplashScreenDLOG    401
  39.  
  40.  
  41. /***  FUNCTIONS  ***/
  42.  
  43. /*  */
  44. void
  45. SplashScreenCreate ( void )
  46. {
  47.     ParamText ( gVersionStr, NULL, NULL, NULL );
  48.     
  49.     /* get dialog ptr from resource file */
  50.     vSplashScreenDlog = GetNewDialog ( kSplashScreenDLOG, NULL, (WindowPtr)-1L );
  51.     if ( vSplashScreenDlog != NULL )
  52.     {
  53.         /* dialog load successful */
  54.         SetWRefCon ( vSplashScreenDlog, (long)kSplashScreenDLOG );
  55.         
  56.         /* save the current port, whatever it is */
  57.         GetPort ( &vSplashScreenSavePort );
  58.         
  59.         /* now make it visible */
  60.         ShowWindow        ( vSplashScreenDlog );
  61.         SelectWindow    ( vSplashScreenDlog );
  62.         DrawDialog        ( vSplashScreenDlog );
  63.     }
  64. } /* SplashScreenCreate */
  65.  
  66.  
  67. /*  */
  68. void
  69. SplashScreenDispose ( void )
  70. {
  71.     if ( vSplashScreenDlog != NULL )
  72.     {
  73.         my_assert ( vSplashScreenSavePort != NULL, "\pSplashScreenDispose: vSplashScreenSavePort is nil" );
  74.         
  75.         DisposeDialog    ( vSplashScreenDlog );
  76.         SetPort            ( vSplashScreenSavePort );
  77.     }
  78. } /* SplashScreenDispose */
  79.  
  80.  
  81. #endif    /* kCompileWithForeground && kCompileWithSplashScreen */
  82.  
  83. /*****  EOF  *****/
  84.